package main

import "fmt"

func main() { //会打印 0 2 4 6 8

	ch := make(chan int, 1)
	for i := 0; i < 10; i++ {
		select {
		case x := <-ch: //1 3 5 7 9进这case
			fmt.Println(x) //打印的是 因为一个case放进去 0 2 4 6 8
		case ch <- i: //0 2 4 6 8  进这case
		}
	}
}
